package user;
import book.booklist;
import java.util.Scanner;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2022-11-18
 * Time: 20:44
 */
public class Main {
    public static User func(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的姓名");
        String name=scanner.nextLine();
        System.out.println("请输入你的身份");
        System.out.println("1. 普通用户      0.管理员   ");
        int choice=scanner.nextInt();
        if(choice==1){
            return new regularuser(name);
        }else
        {
           return new Manageuser(name);
        }
    }
    public static void main(String[] args) {
        booklist booklist1 = new booklist();
        User user= func();
        while(true) {
            int choice = user.menu();
            user.work(choice, booklist1);
        }
    }
}
